package com.hunsy.d2d.mqtt.netty.handler.tcp;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.mqtt.MqttDecoder;
import io.netty.handler.codec.mqtt.MqttEncoder;

/**
 * TCP
 * Created by hunsy on 2017/5/3.
 */
public class TcpInitializer extends ChannelInitializer<NioServerSocketChannel> {

    protected void initChannel(NioServerSocketChannel ch) throws Exception {

        ChannelPipeline pipeline = ch.pipeline();

        pipeline.addLast(new MqttEncoder());
        pipeline.addLast(new MqttDecoder());
//        pipeline.addLast(new )
    }
}
